aspectframe: Remove priv pointer
authorTimm Bäder <mail@baedert.org>
Sun, 8 Jul 2018 08:02:43 +0000 (10:02 +0200)
committerTimm Bäder <mail@baedert.org>
Sun, 8 Jul 2018 08:02:43 +0000 (10:02 +0200)
gtk/gtkaspectframe.c
gtk/gtkaspectframe.h

index c4b0d7af43eb5b89df7accac87c4fcc306fbf3ba..f07f03ca24b85857de5acd4d039f809ff21d952f 100644 (file)
 
 
 
-struct _GtkAspectFramePrivate
+typedef struct
 {
   gboolean      obey_child;
   gfloat        xalign;
   gfloat        yalign;
   gfloat        ratio;
-};
+} GtkAspectFramePrivate;
 
 
 enum {
@@ -138,12 +138,12 @@ gtk_aspect_frame_class_init (GtkAspectFrameClass *class)
 static void
 gtk_aspect_frame_init (GtkAspectFrame *aspect_frame)
 {
-  aspect_frame->priv = gtk_aspect_frame_get_instance_private (aspect_frame);
+  GtkAspectFramePrivate *priv = gtk_aspect_frame_get_instance_private (aspect_frame);
 
-  aspect_frame->priv->xalign = 0.5;
-  aspect_frame->priv->yalign = 0.5;
-  aspect_frame->priv->ratio = 1.0;
-  aspect_frame->priv->obey_child = TRUE;
+  priv->xalign = 0.5;
+  priv->yalign = 0.5;
+  priv->ratio = 1.0;
+  priv->obey_child = TRUE;
 }
 
 static void
@@ -153,7 +153,7 @@ gtk_aspect_frame_set_property (GObject         *object,
                               GParamSpec      *pspec)
 {
   GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (object);
-  GtkAspectFramePrivate *priv = aspect_frame->priv;
+  GtkAspectFramePrivate *priv = gtk_aspect_frame_get_instance_private (aspect_frame);
   
   switch (prop_id)
     {
@@ -199,7 +199,7 @@ gtk_aspect_frame_get_property (GObject         *object,
                               GParamSpec      *pspec)
 {
   GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (object);
-  GtkAspectFramePrivate *priv = aspect_frame->priv;
+  GtkAspectFramePrivate *priv = gtk_aspect_frame_get_instance_private (aspect_frame);
   
   switch (prop_id)
     {
@@ -249,8 +249,7 @@ gtk_aspect_frame_new (const gchar *label,
   GtkAspectFramePrivate *priv;
 
   aspect_frame = g_object_new (GTK_TYPE_ASPECT_FRAME, NULL);
-
-  priv = aspect_frame->priv;
+  priv = gtk_aspect_frame_get_instance_private (aspect_frame);
 
   priv->xalign = CLAMP (xalign, 0.0, 1.0);
   priv->yalign = CLAMP (yalign, 0.0, 1.0);
@@ -284,12 +283,10 @@ gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
                      gfloat          ratio,
                      gboolean        obey_child)
 {
-  GtkAspectFramePrivate *priv;
+  GtkAspectFramePrivate *priv = gtk_aspect_frame_get_instance_private (aspect_frame);
 
   g_return_if_fail (GTK_IS_ASPECT_FRAME (aspect_frame));
 
-  priv = aspect_frame->priv;
-  
   xalign = CLAMP (xalign, 0.0, 1.0);
   yalign = CLAMP (yalign, 0.0, 1.0);
   ratio = CLAMP (ratio, MIN_RATIO, MAX_RATIO);
@@ -333,7 +330,7 @@ gtk_aspect_frame_compute_child_allocation (GtkFrame      *frame,
                                           GtkAllocation *child_allocation)
 {
   GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (frame);
-  GtkAspectFramePrivate *priv = aspect_frame->priv;
+  GtkAspectFramePrivate *priv = gtk_aspect_frame_get_instance_private (aspect_frame);
   GtkBin *bin = GTK_BIN (frame);
   GtkWidget *child;
   gdouble ratio;
index be06f1fb1806315681867ab227294c0184e8c04c..6fd4be65351b1f5f150e600752a4e7787b2f5df7 100644 (file)
@@ -43,15 +43,11 @@ G_BEGIN_DECLS
 #define GTK_ASPECT_FRAME_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ASPECT_FRAME, GtkAspectFrameClass))
 
 typedef struct _GtkAspectFrame              GtkAspectFrame;
-typedef struct _GtkAspectFramePrivate       GtkAspectFramePrivate;
 typedef struct _GtkAspectFrameClass         GtkAspectFrameClass;
 
 struct _GtkAspectFrame
 {
-  GtkFrame frame;
-
-  /*< private >*/
-  GtkAspectFramePrivate *priv;
+  GtkFrame parent_instance;
 };
 
 /**